<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>分店管理-设置</title>
	<link rel="stylesheet" href="/js/plugin/layui-v2.3.0/layui/css/layui.css">
	<link rel="stylesheet" href="/css/reset.css">
	<link rel="stylesheet" href="/css/index.css">
	<link rel="stylesheet" href="/css/project_set.css"> 
	<script src="/js/jquery-2.1.1.min.js"></script>
	<link rel="stylesheet" href="/css/workpos.css">
	<script src="/js/plugin/layui-v2.3.0/layui/layui.js"></script>
</head>
<style>
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background-color: #F5F5F5;
    cursor: pointer;
}
::-webkit-scrollbar-thumb {
    background-color: #a2a2a2;
    border-radius: 2px;
}
/* ::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
    background-color: #ffffff;
}  */
 body{
	overflow-y: scroll; 
}   
</style>
<body>
<div class="kb-out-box">
	<header class=" position-header">
		<span class="f-left " style="font-size: 24px;">工位</span>
		<div class="edit-way f-right">
			<a href="javascript:void(0)">平面图</a>
			<a class=" active" href="javascript:void(0)">列表显示</a>
		</div>
	</header>
	<div class="kb-content my-locations-list">	
		<div class="nav-container f-left">
			<div class="nav-container-content">
				<header class="nav-header">
					<h2 class="header-title">分区</h2>
					<div class="nav-header-btn" id="add_partition"><a class="add-btn" href="javascript:void(0)">添加新分区</a></div>
				</header>
				<div class="nav-body">
					<div style="width: 100%; height: 100%; position: relative;">
						<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
							<ul class="layui-tab-title" id="partitionState">
							    <li class="layui-this" >所有</li>
							    <li value="1">开放</li>
							    <li value="2">封闭</li>
							</ul>
							<div class="layui-tab-content">
								<ul class="nav-container-list" id="partitionList">
									<!-- <li class="active">
										<a href="javascript:void(0)">
											<span class="default-space open-space" style="margin-right: 10px;">开放</span>头等舱 
											<div class="proportion-bar">
												<div class="proportion-bar_show color-free" style="width: 12.5px;"></div>
											</div>
										</a>
										<span class="station-num">0/0</span>
									</li>
									<li>
										<a href="javascript:void(0)">
											<span class="default-space close-space" style="margin-right: 10px;">封闭</span>头等舱 
											<div class="proportion-bar">
												<div class="proportion-bar_show color-full" style="width: 12.5px;"></div>
											</div>
										</a>
										<span class="station-num">0/0</span>
									</li>
									<li>
										<a href="javascript:void(0)">
											<span class="default-space close-space" style="margin-right: 10px;">封闭</span>头等舱 
											<div class="proportion-bar">
												<div class="proportion-bar_show color-full" style="width: 12.5px;"></div>
											</div>
										</a>
										<span class="station-num">0/0</span>
									</li>
									<li>
										<a href="javascript:void(0)">
											<span class="default-space close-space" style="margin-right: 10px;">封闭</span>头等舱 
											<div class="proportion-bar">
												<div class="proportion-bar_show color-full" style="width: 12.5px;"></div>
											</div>
										</a>
										<span class="station-num">0/0</span>
									</li>
									<li>
										<a href="javascript:void(0)">
											<span class="default-space close-space" style="margin-right: 10px;">封闭</span>头等舱 
											<div class="proportion-bar">
												<div class="proportion-bar_show color-full" style="width: 12.5px;"></div>
											</div>
										</a>
										<span class="station-num">0/0</span>
									</li>
									
									
									<li>
										<a href="javascript:void(0)">
											<span class="default-space close-space" style="margin-right: 10px;">封闭</span>头等舱 
											<div class="proportion-bar">
												<div class="proportion-bar_show color-full" style="width: 12.5px;"></div>
											</div>
										</a>
										<span class="station-num">0/0</span>
									</li> -->
								</ul>
							</div>
						</div> 
					</div>
				</div>
			</div>
		</div>	
		<div class="nav-section-container nav-section-container-bg f-right">
			<div style="width: 100%;min-height: 100%; position: relative;" id="iframepage-wrap">
				<header class="nav-header" id="head_data">
					<div class="clearfix">
						<h2 class="nav-section-header-title f-left"><span>头等舱 </span></h2>	
						<div class="f-right">
							<button class="layui-btn layui-btn-radius layui-btn-normal"><i class="layui-icon">&#xe642;</i> 编辑</button>
							<button class="layui-btn layui-btn-radius layui-btn-normal"><i class="layui-icon">&#xe654;</i> 添加</button>
							<button class="layui-btn layui-btn-radius layui-btn-normal"><i class="layui-icon">&#xe640;</i> 删除</button>
						</div>
					</div>
					<div class="color-nine clearfix">

						<div class="f-right">
						
						</div>
					</div>
				</header>
				<div class="nav-section-content-container">
					<div class="nav-section-action-bar">
						<div class="select-progress">
							<span style="margin-right: 8px;">选择工位状态</span>
							<div class="d-iblock">
								<div class="color-show">
									<span class="station-empty"></span>
								</div>
								<span class="receipt-status ">未分配</span> 	
							</div>
							<div class="d-iblock">
								<div class="color-show">
									<span class="station-occupy"></span>
								</div>
								<span class="receipt-status">已分配</span> 	
							</div>
							<div class="d-iblock">
								<div class="color-show">
									<span class="station-expiring"></span>
								</div>
								<span class="receipt-status">快到期</span> 	
							</div>
							<div class="d-iblock">
								<div class="color-show">
									<span class="station-reserved"></span>
								</div>
								<span class="receipt-status">已出租</span> 	
							</div>
						</div>
					</div>
					<div class="clear-criteria" >
						<button id="clear-btn" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-danger hide"><i class="layui-icon">&#x1006;</i>清除所有选项</button>
					</div>
					<div style="width: 100%; height: 100%; position: relative;">
						<div class="station-all clearfix" id="station-all">
							<!-- <div class="desk-box">
								<div class="station-box station-occupy">
									<span>201</span>
									<div class="station-message">
										<span class="station-status">田茂昌</span>
										<span class="station-user">已分配</span>
									</div>
								</div>
								
							</div> -->
						</div>
						<div id="page-break"></div>
					</div>
				</div>
			</div>
		</div>	
	</div>
</div>
</body>
<script>
var type;
var partitionId;
var laypage;
var state;
var projectId;
function test(h){
	document.getElementById("iframepage-wrap").style.height = h+"px"
   }
$(function(){
	projectId=top.$("#projectId").val();
	console.log(projectId);
	getPartition();
	getHrdeData();
	/* 分区类型得点击事件 */
	$("#partitionState li").on("click",function(){
		type = $(this).attr("value");
		if(type==null){
			getHrdeData();
			partitionId=undefined;
			getStationList();
		}
		getPartition(type);
		
		
	})
	/* 分区类下面得列表点击 */
	$("#partitionList").on("click","li",function(){
		var listTarget=$(this);
		renderHeader(listTarget,"")
		partitionId=$(listTarget).attr("data-value");
		getStationList(partitionId);
	})
	layui.use(['element',"layer","form",'laypage'], function(){
		var layer=layui.layer,form = layui.form,element=layui.elemnet;
		laypage = layui.laypage;
		//渲染工位
		/*runAsync().then(function(data){
			console.log(data,"aaaaaaaaa")
			renderWorkPos(data)
		})*/
		getStationList(partitionId);
	  
	})
	
	
	
	/*方格切换*/
	$(".nav-section-action-bar").on("click",".receipt-status",function(){
		var currentClass=$(this).prev('.color-show').children('span').attr("class");
		$('#clear-btn').addClass("show")
		$(".nav-section-action-bar .receipt-status").each(function(index,item){//清除高亮状态
			$(item)[0].setAttribute("class","receipt-status")
		});
		$(this).addClass(currentClass);
		if($(this).text()=="未分配"){
			state=0;
		}else if($(this).text()=="已分配"){
			state=1;
		}else if($(this).text()=="快到期"){
			state=2;
		}else if($(this).text()=="已出租"){
			state=3;
		}
		
		getStationList(partitionId,state);
	});
	/* 清除所有的按钮 */
	$('#clear-btn').on("click",function(){
		$(".nav-section-action-bar .receipt-status").each(function(index,item){//清除高亮状态
			$(item)[0].setAttribute("class","receipt-status")
		});
		$(this).removeClass('show')
		state="";
		getStationList(partitionId);
	})
	$("body").on("click","#add_partition",function(){
			parent.parent.layer.open({
			  type: 2, 
			  title:"添加新分区",
			  area: ['700px','90%'],
		      shade: [0.6, '#010101'],
		      zIndex:800,
			  content:"/app/projectPartition/add" , 
			  end: function () {
				  getPartition(type);
				  getStationList(partitionId,state);
		      }
			});		
		})
	$("body").on("click","#add_partition1",function(){
		parent.parent.layer.open({
		  type: 2, 
		  title:"添加新分区",
		  area: ['700px','90%'],
	      shade: [0.6, '#010101'],
	      zIndex:800,
		  content:"/app/projectPartition/add" , 
		  end: function () {
			  getPartition(type);
			  getStationList(partitionId,state);
	      }
		});		
	})
	clickStateBox()//工位点击入住	
		
});
//基于laypage分页；
function renderWorkPos(data){
 	laypage.render({
	    elem: 'page-break'
	    ,count: data.length
	    ,theme: '#1E9FFF'
	    ,limit:80
	    ,first: '首页'
        ,last: '尾页'
        ,next:"下一页"
        ,pre:"上一页"
	    ,jump: function(obj,first){
	      //模拟渲染,首次不执行
	      if(!first){
	    	  //layer.load();
	    	  renderstateBox(data,obj);
	      }else{
	    	  renderstateBox(data,obj);
	      }
	    }
	});
 }
 //修改分区
	function editPartition(id){
		parent.parent.layer.open({
			  type: 2, 
			  title:"修改分区",
			  area: ['700px','90%'],
		      shade: [0.6, '#010101'],
		      zIndex:800,
			  content:"/app/projectPartition/edit/"+id , 
			  end: function () {
				  if(type==null){
					  getPartition();
				  }else{
					  getPartition(type);
				  }
				  var listTarget=$("#partitionList li[data-value='"+id+"']");
				  if(listTarget.length>0){
					  renderHeader(listTarget,"");
				  }else{
					  selPartition(id);
				  }
				  
		      }
			});
	}
	function editStation(id){
		parent.parent.layer.open({
			  type: 2, 
			  title:"添加工位",
			  area: ['700px','400px'],
		      shade: [0.6, '#010101'],
		      zIndex:800,
			  content:"/app/projectStation/add/"+id , 
			  end: function () {
				  getStationList(partitionId,state);
		      }
			});
	}
	//删除分区
	function delPartition(id){
		parent.parent.layer.confirm('确认要删除吗，删除后不能恢复', function(index){
	    	//发送删除请求
	    	$.post("/app/projectPartition/delete",{id:id},function(res){
	    		parent.parent.layer.msg(res.msg);
	    		parent.parent.layer.close(index);
	    		getHrdeData();
	    		getPartition(type);
	    		getStationList();
	        },"json");
	  	});	
	}
	//工位
	function getPartition(state){
		var def = $.Deferred();
	　	var url="/app/projectPartition/listdata";
		jQuery.ajax({
	        type:"post",
	        async:false,
	        url:url,
	        dataType:"json",
	        data:{'params[state]':state,'params[fkProject]':projectId},
	        success:function(data){
	        	resolve(data.data);
	        }
	    })
	}
	//更新单个分区信息
	function selPartition(id){
		var url="/app/projectPartition/selPartition";
		jQuery.ajax({
	        type:"post",
	        async:false,
	        url:url,
	        dataType:"json",
	        data:{id:id},
	        success:function(data){
	        	renderHeader("",data);
	        }
	    })
	}
	function getStationList(partitionId,state){
		var url="/app/projectStation/listdata";
		jQuery.ajax({
	        type:"post",
	        async:false,
	        url:url,
	        dataType:"json",
	        data:{'params[partitionId]':partitionId,'params[state]':state,'params[projectId]':projectId},
	        success:function(data){
	        	renderWorkPos(data.data);
	        }
	    })
	}
	//渲染左侧分区列表
	function resolve(data){
		var cont="";
		for (var i = 0; i < data.length; i++) {
			// 0: 灵活办公室1: 开放办公室2:封闭办公室
			if(data[i].partitionType==0){
				cont+='<li data-value="'+data[i].id+'" data-name="'+data[i].partitionName+'" data-alreadyNumber="'+data[i].alreadyNumber+'" data-ratedNumber="'+data[i].ratedNumber+'" data-area="'+data[i].area+'" data-type="灵活办公区" ><a href="javascript:void(0)"><span class="default-space flexible-space" style="margin-right: 10px;">灵活</span>'+data[i].partitionName
					+'<div class="proportion-bar"><div class="proportion-bar_show color-full" style="width: 0px;"></div></div></a>'
					+'<span class="station-num">'+data[i].alreadyNumber+'/'+data[i].ratedNumber+'</span></li>';
			}else if(data[i].partitionType==1){
				cont+='<li data-value="'+data[i].id+'" data-name="'+data[i].partitionName+'" data-alreadyNumber="'+data[i].alreadyNumber+'" data-ratedNumber="'+data[i].ratedNumber+'" data-area="'+data[i].area+'" data-type="开放办公区" ><a href="javascript:void(0)"><span class="default-space open-space" style="margin-right: 10px;">开放</span>'+data[i].partitionName
					+'<div class="proportion-bar"><div class="proportion-bar_show color-full" style="width: 0px;"></div></div></a>'
					+'<span class="station-num">'+data[i].alreadyNumber+'/'+data[i].ratedNumber+'</span></li>';
			}else if(data[i].partitionType==2){
				cont+='<li data-value="'+data[i].id+'" data-name="'+data[i].partitionName+'" data-alreadyNumber="'+data[i].alreadyNumber+'" data-ratedNumber="'+data[i].ratedNumber+'" data-area="'+data[i].area+'" data-type="封闭办公区" ><a href="javascript:void(0)"><span class="default-space close-space" style="margin-right: 10px;">封闭</span>'+data[i].partitionName
					+'<div class="proportion-bar"><div class="proportion-bar_show color-full" style="width: 0px;"></div></div></a>'
					+'<span class="station-num">'+data[i].alreadyNumber+'/'+data[i].ratedNumber+'</span></li>';
			}
		}
		
		$("#partitionList").html(cont)
	}
	function getHrdeData(){
		var con=`<div class="clearfix">`
			+`<h2 class="nav-section-header-title f-left"><span>所有分区 </span></h2>`
			+`<div class="f-right">`
				+`<button class="layui-btn layui-btn-radius layui-btn-normal" id="add_partition1"><i class="layui-icon">&#xe654;</i>添加新分区</button>`
			+`</div>`
		+`</div>`
		+`<div class="color-nine clearfix">`
			+`<div class="all-chart m-updown">`
				+`<div class="chart-box t-left">`
					+`<div class="statistic-box">`
						+`<div class="header">`
							+`<span class="number">6.83</span>`
							+`<span class="unit">%</span>`
						+`</div>`
						+`<div class="name"><span>工位使用率</span></div>`
					+`</div>`
				+`</div>`
				+`<div class="chart-box t-left">`
					+`<div class="statistic-box">`
						+`<div class="header">`
							+`<span class="number">171</span>`
							+`<span class="unit">个</span>`
						+`</div>`
						+`<div class="name"><span>额定总工位数</span></div>`
					+`</div>`
				+`</div>`
				+`<div class="chart-box t-left">`
					+`<div class="statistic-box">`
						+`<div class="header">`
							+`<span class="number">161</span>`
							+`<span class="unit">个</span>`
						+`</div>`
						+`<div class="name"><span>实际总工位数</span></div>`
					+`</div>`
				+`</div>`
				+`<div class="chart-box  t-left">`
					+`<div class="statistic-box">`
						+`<div class="header">`
							+`<span class="number">33</span>`
							+`<span class="unit">个</span>`
						+`</div>`
						+`<div class="name"><span>已出租工位数</span></div>`
					+`</div>`
				+`</div>`
				+`<div class="chart-box  t-left">`
					+`<div class="statistic-box">`
						+`<div class="header">`
							+`<span class="number">11</span>`
							+`<span class="unit">个</span>`
						+`</div>`
						+`<div class="name"><span>实际入驻工位数</span></div>`
					+`</div>`
				+`</div>`
			+`</div>`
		+`</div>`;
		$("#head_data").html(con);
	}
	
	function renderHeader(listTarget,data){
		var val="";
		var name="";
		var area="";
		var type="";
		var gong="已租公司：无";
		var ratedNumber="";
		var alreadyNumber="";
		if(listTarget==""){
			val=data.id;
			name=data.partitionName;
			area=data.area;
			type=data.partitionType;
			ratedNumber=data.ratedNumber;
			alreadyNumber=data.alreadyNumber;
			if(type==0){// 0: 灵活办公室1: 开放办公室2:封闭办公室
				type="灵活办公室";				
				gong="";
			}else if(type==1){
				type="开放办公室";
				gong="";
			}else if(type==2){
				type="封闭办公室";
			}
		}else{
			$(listTarget).addClass("active").siblings('li').removeClass("active");
			val=$(listTarget).attr("data-value");
			name=$(listTarget).attr("data-name");
			area=$(listTarget).attr("data-area");
			type=$(listTarget).attr("data-type");
			ratedNumber=$(listTarget).attr("data-ratedNumber");
			alreadyNumber=$(listTarget).attr("data-alreadyNumber");
			if(type!="封闭办公区"){
				gong="";
			}
		}
		
		
		var con=`<div class="clearfix">`
				+`<h2 class="nav-section-header-title f-left"><span>`+name+`</span></h2>`
				+`<div class="f-right">`
					+`<button class="layui-btn layui-btn-radius layui-btn-normal" onclick=editPartition('`+val+`')><i class="layui-icon">&#xe642;</i> 编辑</button>`
					+`<button class="layui-btn layui-btn-radius layui-btn-normal" onclick=editStation('`+val+`')><i class="layui-icon">&#xe654;</i> 添加</button>`
					+`<button class="layui-btn layui-btn-radius layui-btn-normal" onclick=delPartition('`+val+`')><i class="layui-icon">&#xe640;</i> 删除</button>`
				+`</div>`
			+`</div>`
			+`<div class="color-nine clearfix">`
				+`<div class="f-left" style="padding-top: 10px;">`
					+`<i class="icon-Enclosedspace"></i>`
					+`<span>`+type+`</span>`
					+`<div class="mag-top-20">`
							+`<span class="area-organization">`+gong+`</span>`	
					+`</div>`
				+`</div>`
				+`<div class="f-right">`
					+`<div class="chart-box t-left">`
						+`<div class="statistic-box">`
							+`<div class="header">`
								+`<span class="number">`+area+`</span>`
								+`<span class="unit">㎡</span>`
							+`</div>`
							+`<div class="name"><span>总面积数</span></div>`
						+`</div>`
					+`</div>`
					+`<div class="chart-box  t-left">`
						+`<div class="statistic-box">`
							+`<div class="header">`
								+`<span class="number">`+ratedNumber+`</span>`
								+`<span class="unit">个</span>`
							+`</div>`
							+`<div class="name"><span>额定工位数</span></div>`
						+`</div>`
					+`</div>`
					+`<div class="chart-box  t-left">`
						+`<div class="statistic-box">`
							+`<div class="header">`
								+`<span class="number">`+alreadyNumber+`</span>`
								+`<span class="unit">个</span>`
							+`</div>`
							+`<div class="name"><span>已使用工位数</span></div>`
						+`</div>`
					+`</div>`
				+`</div>`
			+`</div>`;
			$("#head_data").html(con);
	}
function getState(stateNum){
	var stateNum=parseInt(stateNum),resState={};
	switch(stateNum){
	    case 0:
	    	resState.state="station-empty";
	    	resState.stateTxt="未分配";
	    break;
	    case 1:
	    	resState.state="station-occupy";
	    	resState.stateTxt="已分配";
	    break;
	    case 2:
	    	resState.state="station-reserved";
	    	resState.stateTxt="已出租";
		break;
	    case 3:
	    	resState.state="station-expiring";
	    	resState.stateTxt="快到期";
	    break;
	    default:
	    	resState=null;
	}
	
	return resState;
}

//渲染工位，判断不同状态下的划过的内容,基于laypage；
function renderstateBox(data,obj){
	 document.getElementById('station-all').innerHTML = function(){
	        var arr = []
	        ,thisData = data.concat().splice(obj.curr*obj.limit - obj.limit, obj.limit);
	        layui.each(thisData, function(index,item){
		      var stateRes= getState(item.stationState);
		      /* if(item.stationState==1){
		          arr.push(`<div class="desk-box">`
								+`<div class="station-box `+ stateRes.state+`">`
									+`<span>`+item.stationName+`</span>`
									+`<div class="station-message">`
										+`<span class="station-status">小草</span>`
										+`<span class="station-user">`+stateRes.stateTxt+`</span>`
									+`</div>`
								+`</div>`
								+`<div class="station-popup-box" style="top: 80px;">`
									+`<div style="background-color: rgb(0, 0, 0); opacity: 0; height: 5px;"></div>`
									+`<div class="station-popup" style="padding: 20px;">`
										+`<div class="kb-title">`
											+`<span>基本信息</span>`
										+`</div>`
										+`<ul class="basic-message">`
											+`<li class="clearfix">`
												+`<div class="group"><i class="layui-icon"  style="color:#333">&#xe66f;</i><span>田茂昌</span></div>`
												+`<div class="group"><i class="layui-icon" style="color:#333">&#xe68e;</i><span>燕博园</span></div>`
											+`</li>`
											+`<li class="clearfix">`
												+`<div class="group"><i class="layui-icon" style="color:#333">&#xe678;</i><span>13269503421</span></div>`
												+`<div class="group"><i class="layui-icon" style="color:#333">&#xe66e;</i><span>工位号`+item.stationName+`</span></div>`
											+`</li>`
										+`</ul>`
										+`<div class="kb-title"><span>备注</span></div>`
										+`<div class="remark">`
											+`<textarea name="" placeholder="编辑备注"></textarea>`
										+`</div>`
										+`<div class="footer">`
												+`<button class="layui-btn layui-btn-sm layui-btn-normal">个人主页</button>`
										+`</div>`
									+`</div>`
								+`</div>`
							+`</div>`);
		      }else{ */
		    	  var teamName = "";
		      if(item.teamName){
		    	  teamName = item.teamName;
		      }
		    	  arr.push(`<div class="kb_dropdown">`
			    			  +`<a class="kb_dropdown__trigger ">`
						    	  +`<div class="station-box `+ stateRes.state+`">`
										+`<span>`+item.stationName+`</span>`
										+`<div class="station-message">`
											+`<span class="station-status" style="display: block;">`+stateRes.stateTxt+`</span>`
										+`</div>`
										+`<div class="station-popup-box" style="top: 80px;">`
											+`<div style="background-color: rgb(0, 0, 0); opacity: 0; height: 5px;"></div>`
											+`<div class="station-popup" style="padding: 20px;">`
												+`<div class="kb-title">`
													+`<span>基本信息</span>`
												+`</div>`
												+`<ul class="basic-message">`
													+`<li class="clearfix">`
														+`<div class="group"><i class="layui-icon" style="color:#333">&#xe66e;</i><span>工位号`+item.stationName+`</span></div>`
														+`<div class="group"><i class="layui-icon" style="color:#333">&#xe678;</i><span>`+teamName+`</span></div>`
		     										 +`</li>`
												+`</ul>`
											+`</div>`
										+`</div>`
								  +`</div>`
			    	  		  +`</a>`
		    			  	  +`<div class="kb_dropdown__content " style="left: 50%; transform: translateX(-50%);">`
		    			  			+`<div class="user-dropdown">`
		    			  				+`<a>入驻</a><a onclick=delStation('`+item.id+`')>删除</a>`
		    			  			+`</div>`
		    			  	  +`</div>`
						+`</div>`);
		     // }
		    });
	        return arr.join('');
	      }();
};
//工位点击入住
function clickStateBox(){
	$("#station-all").on("click",".kb_dropdown",function(){
		if(!$(this).hasClass('kb_dropdown--active')){
			$(this).addClass('kb_dropdown--active').siblings('.kb_dropdown ').removeClass("kb_dropdown--active");
		}else{
			$(this).removeClass("kb_dropdown--active");
		}
	})
}
function delStation(id){
	
	
	parent.parent.layer.confirm('确认要删除吗，删除后不能恢复', function(index){
    	//发送删除请求
    	$.post("/app/projectStation/delete",{id:id},function(res){
    		parent.parent.layer.msg(res.msg);
    		parent.parent.layer.close(index);
    		var url="/app/projectStation/listdata";
    		jQuery.ajax({
    	        type:"post",
    	        async:false,
    	        url:url,
    	        dataType:"json",
    	        data:{'params[partitionId]':type},
    	        success:function(data){
    	        	renderWorkPos(data.data);
    	        }
    	    })
        },"json");
  	});

	
}
</script>
</html>